|
|
|
|
|
|
|
Determining the Need to Build and Implement ActiveX DLLs and EXEs |
|
|
|
|
|
|
|
|
If you've developed software for a while now, you probably realize that you have reused some of your code over and over again. Structuring these lines of code into objects certainly helps with organizing your code in a logical way, but sometimes organizing code into objects is not enough. Often, you need to organize these objects into components, especially for large-enterprise and commercial software. |
|
|
|
|
|
|
|
|
Components have grown in popularity over the years, thanks in large part to Microsoft's Visual Basic eXtensions (VBX), followed later by OCX technologythe predecessor of ActiveX. Other products contributing to the increasingly widespread use of components include Sun Microsystems' Java/JavaBeans, Visigenic's VisiBroker, and OMG's CORBA, which has been implemented by several vendors, including IONA. |
|
|
|
|
|
|
|
|
Determining the need to build components takes time. Simply having a set of objects does not automatically mean those objects are good candidates for component building. Components require that the interaction between the objects be reusable, and reuse is not identifiable until those objects and their relationships are, in fact, used again. Therefore, you won't necessarily know when you're at a point to build a component until the time you use those objects and object interactions again. Until such time, you can begin learning and planning for the implementation of components. |
|
|
|
|
|
|
|
|
Understanding the ActiveX DLL Project |
|
|
|
|
|
|
|
|
An ActiveX dynamic link library is a component that at runtime exists in the same process as its client application. When a component runs in the same process as its client, the component is said to be an in-process component. The Professional and Enterprise versions of Visual Basic enable you to create DLLs. All the classes in an ActiveX DLL that implement the component's interface must be declared public so that clients of the DLL can access the DLL's services. |
|
|
|
|
|
|
|
|
Visual Basic enables you to have several projects open simultaneously in the development environment when you are creating ActiveX DLL components. This means that you can simultaneously debug that component with an executable (EXE) project. Visual Basic also provides Automatic Quick Info and Data Tips to assist in your debugging efforts. You can even test your component in both design mode and run mode. |
|
|
|
|
|
|
|
|
Each ActiveX DLL you create contains a type library. |
|
|
|
|
|